<%@page import="java.util.Iterator"%>
<%@page import="java.util.Collection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="common.jsp"%>
<jsp:useBean id="cart" scope="session" class="cn.jhc.bean.CartBean"></jsp:useBean>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/music.css"></link>
<title>吉他小店</title>
</head>
<body>
	<div id="wrapper">
		<jsp:include page="./header.jsp"></jsp:include>
		<div id="address">
			<a>当前位置： 吉他小店&gt;结帐中心</a>
		</div>
		<div id="box">
			<div class="shengming">
				<h4>声明:</h4>
				<a> 为方便社员购买吉他，本小店提供吉他样式，社员提交订单后，管理员会与你联系，请社员填写真实信息!</a>
			</div>
		</div>
	<div id="shopcart" align="center">
		<%
			request.setCharacterEncoding("UTF-8");
			String Class = request.getParameter("class");
			String address = request.getParameter("address");
			String contact = request.getParameter("contact");
			String phone = request.getParameter("phone");
			String action = request.getParameter("action");
			UserBean user = (UserBean) session.getAttribute("user");
			if (null == user) {
				String getb = (String) request.getParameter("getb");
				RequestDispatcher dispatcher = request
						.getRequestDispatcher("/login.jsp");
				dispatcher.forward(request, response);
				return;
			}

			if (action != null && action.equals("确定") && Class != null
					&& address != null && contact != null && phone != null
					&& !Class.equals("") && !address.equals("")
					&& !contact.equals("") && !phone.equals("")) {
		%>
		<jsp:include page="addlist.jsp" flush="false" />
		<%
			shopdb.buyShop(cart);
				cart.clear();
				out.println("<font color=\"orange\" size=\"4\">");
				out.print("订单提交成功!");
				out.println("</font>");
		%>
		<div id="text_link"><a href="index.jsp">返回主页</a></div>
		<%
			} else {
				out.println("<font color=\"orange\" size=\"4\">");
				out.println("所有信息必填");
				out.println("</font>");
		%>
		<%
			if (action != null && action.equals("确定")) {
					out.println("<font color=\"red\" size=\"4\">");
					out.println("请填满所有信息！<p>");
					out.println("</font>");
				}
		%>
		<form name="thesm" action="settlement.jsp" method="post">
			<table width="400">
				<tr height="35">
					<td>学院班级:</td>
					<td><div align="right"><input type="text" name="class" size="35"></div></td>
				</tr>
				<tr height="35">
					<td>联系地址:</td>
					<td><div align="right"><input type="text" name="address" size="35"></div></td>
				</tr>
				<tr height="35">
					<td>联系人:</td>
					<td><div align="right"><input type="text" name="contact" size="35"></div></td>
				</tr>
				<tr height="35">
					<td>联系电话:</td>
					<td><div align="right"><input type="text" name="phone" size="35"></div></td>
				</tr>
			</table>
			<input type="submit" name="action" value="确定">

		</form>
		<%
			}
		%>
	</div>
	<div id="button_bg"></div>
		<div id="line2"></div>
		<div id="copyright">
			<a>&copy;版权所有:蓝调吉他社 </a><a>| </a>
			<div id="admin">
				<a href="houtai_index.jsp">管理员登录</a>
			</div>
		</div>
	</div>
</body>
</html>
